home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.5 Applications 2004 April
/
SGI IRIX 6.5 Applications 2004 April.iso
/
dist
/
sgimeeting.idb
/
usr
/
bin
/
X11
/
sgimeeting.z
/
sgimeeting
Wrap
Text File
|
2003-09-23
|
6KB
|
185 lines
#!/bin/sh
#Tag 0x0001064C
#
# Add Path: Add to the path variable named by $1 the component $2. $3
# must be "append" or "prepend" to indicate where the component is added.
#
addpath () {
eval value=\"\$$1\"
case "$value" in
*:$2:*|*:$2|$2:*|$2)
result="$value"
;;
"")
result="$2"
;;
*)
case "$3" in
p*)
result="$2:${value}"
;;
*)
result="${value}:$2"
;;
esac
esac
eval $1=$result
unset result value
}
#
# Create a directory for received files in the user's home directory
# and mention it in the config file
#
SetRcvDir() {
if [ -d ${HOME}/.sgimeeting-rcv-files ]; then
if [ -w ${HOME}/.sgimeeting-rcv-files ]; then
# directory exists and is writable - use it
echo "Command Centre.ReceiveDir: ${HOME}/.sgimeeting-rcv-files" >> ${HOME}/.sgimeeting
else
# directory exists but is not writable - go to /tmp
echo "Command Centre.ReceiveDir: /tmp" >> ${HOME}/.sgimeeting
fi
else
# try to create the received files directory
mkdir ${HOME}/.sgimeeting-rcv-files
if [ -d ${HOME}/.sgimeeting-rcv-files ]; then
# we made the directory OK - use it
echo "Command Centre.ReceiveDir: ${HOME}/.sgimeeting-rcv-files" >> ${HOME}/.sgimeeting
else
# could not make the directory - go to /tmp
echo "Command Centre.ReceiveDir: /tmp" >> ${HOME}/.sgimeeting
fi
fi
}
#
# Update the users config file. Grep out the useful information
#
UpdateConfig() {
mv ${HOME}/.sgimeeting /tmp/.sgimeeting
echo "VERSION: $CURVERSION" > ${HOME}/.sgimeeting
grep "Command Centre" /tmp/.sgimeeting | grep -v "ReceiveDir" >> ${HOME}/.sgimeeting
grep "Site Name" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Message" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.Left" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.Top" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.Width" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.Height" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.Printer" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.GSPath" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
grep "Whiteboard.SgiPktRecLength" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
# if there is an existing receive dir entry, and
# if it is NOT the home directory, move it across to
# the updated config file
needToSetRcv="TRUE"
rdEntry=`grep "Command Centre.ReceiveDir" /tmp/.sgimeeting`
if [ "$rdEntry" != "" ]; then
rdir=`echo $rdEntry | sed 's/ *Command Centre.ReceiveDir *: *//'`
if [ "$rdir" != "$HOME" ]; then
grep "Command Centre.ReceiveDir" /tmp/.sgimeeting >> ${HOME}/.sgimeeting
needToSetRcv="FALSE"
fi
fi
rm /tmp/.sgimeeting
# Now we have the config file in place, set the receive directory
# if necessary
if [ "$needToSetRcv" = "TRUE" ]; then
SetRcvDir
fi
}
usage () {
if [ $1 = nopath ]; then
echo "Cannot find path for SGImeeting - Please check installation"
elif [ $1 = help ]; then
echo "usage: sgimeeting [options]"
echo
echo " options: -visual 0xnn"
echo " use visual 0xnn for shadow windows"
echo " -install"
echo " install a private colormap using visual specified"
echo " -noinstall"
echo " do not install a private colormap"
echo " -runinbackground"
echo " start running in the background"
echo " -speeddial <filename>"
echo " process the speed dial file <filename>"
echo
echo " By default SGImeeting will use a 24bpp TrueColor visual if available."
echo " If not the default visual and colormap are used."
fi
echo
}
#
# Start of main script
#
#
# Check if the user is asking for help and if so give it to them.
#
if [ .$1 = ".-help" ]; then
echo
usage help
exit 1
fi
#
# Check to see if this is the first time in. If so we want to run
# ourselves in the background.
#
if [ .$1 != ".bg" ]; then
$0 bg "$@" &
exit 0
fi
#
# Determine if the user has a config file which is for an earlier
# version of the product. If so, update it
#
# If there's no config file then create a new one, stamped with
# the correct version number.
#
CURVERSION=`awk '/VERSION/ {print $2}' /usr/SGImeeting/config/sgimeeting`
if [ -f ${HOME}/.sgimeeting ]; then
OLDVERSION=`awk '/VERSION/ {print $2}' ${HOME}/.sgimeeting`
if [ -n "$CURVERSION" ]; then
if [ -z "$OLDVERSION" ]; then
UpdateConfig
elif [ $OLDVERSION -lt $CURVERSION ]; then
UpdateConfig
fi
fi
else
echo "VERSION: $CURVERSION" > ${HOME}/.sgimeeting
SetRcvDir
fi
#
# Record the current directory in case we change to another
# directory below.
#
export DCS_ORIG_PWD=`pwd`
#
# Configuration-specific locations.
#
# run ./bin/sgim_cc followed by ./bin/t120_d
cd /usr/SGImeeting
./bin/sgim_cc "$@"
if [ $? -ne 255 ]; then
./bin/t120_d x > /dev/null
fi